#pragma once

#include "fxcc/core/graph/common/pch.h"

#define MAX_DirNum 8
#define MAX_PointNum 8
#define MAX_SpotNum  8

namespace fxcc
{
    namespace graph {

        namespace opengl3
        {
            using namespace glm;

            namespace phong
            {

                struct FXCC_API DirLight
                {
                    struct FXCC_API Buffer
                    {
                        vec3 ambient = vec3(0.5f, 0.5f, 0.5f);
                        int ambientMap=0;

                        vec3 diffuse = vec3(0.5f, 0.5f, 0.5f);
                        int diffuseMap=0;

                        vec3 specular = vec3(0.5f, 0.5f, 0.5f);
                        int specularMap=0;

                        vec3 direction = vec3(0.0f, -1.0f, 0.f);
                        float pad;
                    } m_Buffer;
                    // struct FXCC_API Map
                    // {

                    // };
                };

                struct FXCC_API PointLight
                {
                    struct FXCC_API Buffer
                    {
                        vec3 ambient = vec3(0.5f, 0.5f, 0.5f);
                        int ambientMap = 0;

                        vec3 diffuse = vec3(0.5f, 0.5f, 0.5f);
                        int diffuseMap = 0;

                        vec3 specular = vec3(0.5f, 0.5f, 0.5f);
                        int specularMap = 0;

                        vec3 position = vec3(0.0f);
                        float pad;

                        float constant = 1.0f;
                        float linear = 0.09;
                        float quadratic = 0.032;
                        float pad4;
                    } m_Buffer;

                };

                struct FXCC_API SpotLight
                {
                    struct FXCC_API Buffer
                    {
                        vec3 ambient = vec3(0.5f, 0.5f, 0.5f);
                        int ambientMap = 0;

                        vec3 diffuse = vec3(0.5f, 0.5f, 0.5f);
                        int diffuseMap = 0;

                        vec3 specular = vec3(0.5f, 0.5f, 0.5f);
                        int specularMap = 0;


                        vec3 position = vec3(0.0f, 2.0f, 0.f);
                        float cutOff = glm::cos(glm::radians(12.5f));
                        vec3 direction = vec3(0.f, -1.0f, 0.0f);
                        float outerCutOff = glm::cos(glm::radians(15.0f));

                        float constant = 1.0f;
                        float linear = 0.09;
                        float quadratic = 0.032;
                        float pad;
                    }m_Buffer;

                };


                struct FXCC_API LightEffect {

                    DirLight dirlights[MAX_DirNum];
                    PointLight pointLights[MAX_PointNum];
                    SpotLight spotLights[MAX_SpotNum];

                    int numDirlights = 0;
                    int numPoints = 0;
                    int numSpotLights = 0;
                    int pad = 0;

                };
            };
        };
    }
}